package com.example.intenttrial;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Gallery;

import com.example.intenttrial.adapters.GalleryAdapter;

public class GalleryActivity extends Activity {

	private Gallery gallery;
	private GalleryAdapter adapter;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.screen_gallery);
		gallery = (Gallery) findViewById(R.id.gv_members);
	}

	@Override
	protected void onResume() {
		super.onResume();
		adapter = new GalleryAdapter(getApplicationContext());
		gallery.setAdapter(adapter);
		gallery.setOnItemClickListener(new AdapterView.OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int position,
					long arg3) {
				System.out.println(adapter.getItem(position));
			}
			
		});
	}

}
